<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form method="POST">
        <input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token }}">
        <label>作者:</label><input id="author"name="author" type="text" value=""><br>
        <label>书名:</label><input id="book" name="book" type="text" value=""><br>
        <input id="submit" name="submit" type="submit" value="添加"><br>
    </form>
    <br>
        {{ get_flashed_messages() }}
    <br>
{% for message in get_flashed_messages() %}
    {{ message }}
{% endfor %}

<ul>
    {% for author in authors %}
        <li>{{ author.name }}<a href="/delete_author?aid={{ author.id }}">删除</a> </li>
        <ul>
            {% for book in author.books %}
                <li>{{ book.name }}<a href="/delete_book?bid={{ book.id }}">删除</a> </li>
            {% else %}
                <li>无</li>
            {% endfor %}

        </ul>
    {% endfor %}

</ul>

</body>
</html>